<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<?php
//no direct access
defined('_JEXEC') or die( 'Restricted access' );
//import the JController Class
jimport( 'joomla.application.component.view' );


class NvViewYoutube extends JView {
	
	/* fungsi display default
	 * @void
	 */
    function display(){
    	
    	
    	if($this->getLayout() == 'single'){
		
    	$videoid = JRequest::getVar('videoid',0);
    	$videotitle = JRequest::getVar('videotitle',0);
    	$videothumbnail = JRequest::getVar('videothumbnail',0);
    	$videourl = JRequest::getVar('videourl',0);
    	$videodesc = JRequest::getVar('videodesc',0);
    	$videoplayer = JRequest::getVar('videoplayer',0);
    	$videolink = JRequest::getVar('videolink',0);
    	$videoauthorname = JRequest::getVar('videoauthorname',0);
    	$videoauthorlink = JRequest::getVar('videoauthorlink',0);
    	
    	$dataVid = new stdClass();
    	
    	$dataVid->videoid = $videoid;
    	$dataVid->videotitle = $videotitle;
    	$dataVid->videothumbnail = $videothumbnail;
    	$dataVid->videourl = $videourl;
    	$dataVid->videodesc  = $videodesc ;
    	$dataVid->videoplayer  = $videoplayer ;
    	$dataVid->videolink  = $videolinkc ;
    	$dataVid->videoauthorname  = $videoauthorname ;
    	$dataVid->videoauthorlink  = $videoauthorlink ;
    	
    	
    	
    	
    	$this->assignRef('data',$dataVid);

    	
    	}else{
    		
    	//get youtube model object
    	$model = $this->getModel('youtube');
    	
    	//get data array from youtube model
    	$dataArr = $model->getVideoList('indonesia',20);
    	
    	$this->assignRef('data',$dataArr);
    	
    	}
    	parent::display();
    }
}
?>
